﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KINLO.Model.MES
{
    [Serializable]
    public class MESEquipmentStatusModel
    {
        /// <summary>
        /// 设备编码
        /// </summary>
        public string EquipmentCode { get; set; }
        /// <summary>
        ///0:待机、1:运行、2:故障、3:报警
        /// </summary>
        public string State_Code { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public string Beg_time { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public string End_time { get; set; }
        /// <summary>
        /// 待机时间(秒)
        /// </summary>
        public string St_seconds { get; set; }
        /// <summary>
        /// 待机原因编码
        /// </summary>
        public string St_ResonCode { get; set; }
        /// <summary>
        /// 报警原因编码
        /// </summary>
        public string Alarm_ResonCode { get; set; }
        /// <summary>
        /// 报警原因名称
        /// </summary>
        public string Alarm_ResonName { get; set; }
        /// <summary>
        /// 类型 固传1   1:设备履历s
        /// </summary>
        public string Type { get; set; } = "1";
    }
    [Serializable]
    public class MESEquipmentStatusRoot
    {
        public MESEquipmentStatusRoot()
        {
            data = new List<MESEquipmentStatusModel>();
        }
        public List<MESEquipmentStatusModel> data { get; set; }
    }

    public class MESEquipmentStatuLogDataModel : MESEquipmentStatusRoot
    {
        /// <summary>
        /// 序号
        /// </summary>
        public Guid ID { get; set; }
        /// <summary>
        /// 上传结果
        /// </summary>
        public string Result { get; set; }
        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime UploadedDate { get; set; }

        /// <summary>
        /// 补录时间
        /// </summary>
        public DateTime SupplementalDate { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 当前状态 -1 上传失败 0 重新上传失败 1 重新上传成功
        /// </summary>
        public int CurrentStatus { get; set; } = -1;
    }
}
